Ext.define('EUniversitySuperAdmin.tabview.Viewer', {
    extend: 'Ext.tab.Panel',
    alias: 'widget.tabsview',
    activeItem: 0,
    margins: '5 5 5 5',
    initComponent: function() {
    	 this.items = [{
		            title: 'Acceuil',
		             items:[
		        	{
		        		xtype: 'button',
		        		text: t('etudiant'),
		        		handler:function(){
		        			alert(t('etudiant'));
		        		}
		        	}
		        ],
		            html: 'The first tab\'s content. Others may be added dynamically'
		       }];
    	
       this.callParent(arguments);
    }
});



Ext.define('EUniversitySuperAdmin.view.Viewport', {
    extend: 'Ext.container.Viewport', 
    alias: 'widget.viewport',
    requires: [
               	'EUniversitySuperAdmin.controller.analyticboard'
               
           ],
    refs : [{
        ref: 'tabsview',
        selector: 'tabsview'
    },{
    	ref:'analyticboard',
    	selector:'analyticboard'
    }],
     layout: 'border',
	
		    items: [
		    
		     {

                region: 'north',
                height: 24,

                tbar: [
               /////////////////////////////
                       {
                	// split: true,
                   text: 'Gestion Des Projets',//gestion
                    menu: [
                           
                          
                                    {
			                        text: 'Ajouter projet',/////////////////////////////////////
			                        handler: function() { // adding a handler to "Add New X" menu item
			                        	Ext.getCmp("tabs").add(
						        				{
						        					title: 'Ajout projet',/////////////////////////
						        					height:'300',
						        					closable:true,
					        				        xtype : "component",
					        				        id    : "management_"+Ext.getCmp("tabs").items.length+1,
					        				        loadScripts: true,
					        				        scripts: true,
					        				        autoEl : {
					        				            tag : "iframe",
					        				            src : "pilotage/Manageproject/addproject"
					        				        }
						        				    
						        				}
						        		).show();
						     
			                        }
			
			                    }, 
			                    {
			                        text: 'Consultation des projet',
			                        handler: function() { // adding a handler to "Add New X" menu item
			                        	Ext.getCmp("tabs").add(
						        				{
						        					title: 'Consulter les projets',
						        					height:'300',
						        					closable:true,
					        				        xtype : "component",
					        				        id    : "management_"+Ext.getCmp("tabs").items.length+1,
					        				        loadScripts: true,
					        				        scripts: true,
					        				        autoEl : {
					        				            tag : "iframe",
					        				            src : "pilotage/Manageproject/affichprojet"
					        				        }
						        				    
						        				}
						        		).show();
						     
			                        }
			
			                    },
			                    
			                    {
			                        text: 'Gerer les projets',
			                        handler: function() { // adding a handler to "Add New X" menu item
			                        	Ext.getCmp("tabs").add(
						        				{
						        					title: 'Gestion des projets',
						        					height:'300',
						        					closable:true,
					        				        xtype : "component",
					        				        id    : "management_"+Ext.getCmp("tabs").items.length+1,
					        				        loadScripts: true,
					        				        scripts: true,
					        				        autoEl : {
					        				            tag : "iframe",
					        				            src : "pilotage/Manageproject/gestionproject"
					        				        }
						        				    
						        				}
						        		).show();
						     
			                        }
			
			                    },
			                    
			                  
			                   			                   			                    
			                    {
			                        text: 'Assigner des modeles',
			                        handler: function() { // adding a handler to "Add New X" menu item
			                        	Ext.getCmp("tabs").add(
						        				{
						        					title: 'Assigner les modeles',
						        					height:'300',
						        					closable:true,
					        				        xtype : "component",
					        				        id    : "management_"+Ext.getCmp("tabs").items.length+1,
					        				        loadScripts: true,
					        				        scripts: true,
					        				        autoEl : {
					        				            tag : "iframe",
					        				            src : "pilotage/Manageproject/assignermodele"
					        				        }
						        				    
						        				}
						        		).show();
						     
			                        }
			
			                    },
			                    
			                    {
			                        text: 'Gestion d\'assignement des modeles',
			                        handler: function() { // adding a handler to "Add New X" menu item
			                        	Ext.getCmp("tabs").add(
						        				{
						        					title: 'Gestion d\'assignement des modeles',
						        					height:'300',
						        					closable:true,
					        				        xtype : "component",
					        				        id    : "management_"+Ext.getCmp("tabs").items.length+1,
					        				        loadScripts: true,
					        				        scripts: true,
					        				        autoEl : {
					        				            tag : "iframe",
					        				            src : "pilotage/Manageproject/gestionassignemodelprojet"
					        				        }
						        				    
						        				}
						        		).show();
						     
			                        }
			
			                    }
			                    
			               ]

                }
                       
                       
                       //////////////////////////////////////
                       
                       
                       ,
                {
                   text: 'Gestion Des Modeles',
                	   
                	   menu: [
                	          
{
    text: 'Ajouter un modele d\'analyse',
    handler: function() { // adding a handler to "Add New X" menu item
    	Ext.getCmp("tabs").add(
				{
					title: 'Ajout modele',
					height:'300',
					closable:true,
			        xtype : "component",
			        id    : "management_"+Ext.getCmp("tabs").items.length+1,
			        loadScripts: true,
			        scripts: true,
			        autoEl : {
			            tag : "iframe",
			            src : "pilotage/modelmangement/addmodele"
			        }
				    
				}
		).show();

    }

},
     

{
    text: 'Gerer les modeles d\'analyse',
    handler: function() { // adding a handler to "Add New X" menu item
    	Ext.getCmp("tabs").add(
				{
					title: 'Gerer les modeles',
					height:'300',
					closable:true,
			        xtype : "component",
			        id    : "management_"+Ext.getCmp("tabs").items.length+1,
			        loadScripts: true,
			        scripts: true,
			        autoEl : {
			            tag : "iframe",
			            src : "pilotage/modelmangement/gestionmodele"
			        }
				    
				}
		).show();

    }

},

{
    text: 'Ajouter une activite',
    handler: function() { // adding a handler to "Add New X" menu item
    	Ext.getCmp("tabs").add(
				{
					title: 'Ajout activite',
					height:'300',
					closable:true,
			        xtype : "component",
			        id    : "management_"+Ext.getCmp("tabs").items.length+1,
			        loadScripts: true,
			        scripts: true,
			        autoEl : {
			            tag : "iframe",
			            src : "pilotage/modelmangement/addactivite"
			        }
				    
				}
		).show();

    }

},

{
    text: 'Ajouter un axe d\'analyse',
    handler: function() { // adding a handler to "Add New X" menu item
    	Ext.getCmp("tabs").add(
				{
					title: 'Ajout Axe',
					height:'300',
					closable:true,
			        xtype : "component",
			        id    : "management_"+Ext.getCmp("tabs").items.length+1,
			        loadScripts: true,
			        scripts: true,
			        autoEl : {
			            tag : "iframe",
			            src : "pilotage/modelmangement/addaxes"
			        }
				    
				}
		).show();

    }

},

{
    text: 'Assigner les axes',
    handler: function() { // adding a handler to "Add New X" menu item
    	Ext.getCmp("tabs").add(
				{
					title: 'Assigner les axes',
					height:'300',
					closable:true,
			        xtype : "component",
			        id    : "management_"+Ext.getCmp("tabs").items.length+1,
			        loadScripts: true,
			        scripts: true,
			        autoEl : {
			            tag : "iframe",
			            src : "pilotage/modelmangement/assigneactivitemodel"
			        }
				    
				}
		).show();

    }

},

{
    text: 'Gestion d\'assignement des axes',
    handler: function() { // adding a handler to "Add New X" menu item
    	Ext.getCmp("tabs").add(
				{
					title: 'Gestion d\'assignement des axes',
					height:'300',
					closable:true,
			        xtype : "component",
			        id    : "management_"+Ext.getCmp("tabs").items.length+1,
			        loadScripts: true,
			        scripts: true,
			        autoEl : {
			            tag : "iframe",
			            src : "pilotage/modelmangement/gestionassigneaxeactivite"
			        }
				    
				}
		).show();

    }

},

{
    text: 'Assigner les activites au modeles',
    handler: function() { // adding a handler to "Add New X" menu item
    	Ext.getCmp("tabs").add(
				{
					title: 'Assigner les activites au modele',
					height:'300',
					closable:true,
			        xtype : "component",
			        id    : "management_"+Ext.getCmp("tabs").items.length+1,
			        loadScripts: true,
			        scripts: true,
			        autoEl : {
			            tag : "iframe",
			            src : "pilotage/modelmangement/assignemacitiveanalyse"
			        }
				    
				}
		).show();

    }

},

{
    text: 'Gestion d\'assignement des activites',
    handler: function() { // adding a handler to "Add New X" menu item
    	Ext.getCmp("tabs").add(
				{
					title: 'Gestion d\'assignement des activites',
					height:'300',
					closable:true,
			        xtype : "component",
			        id    : "management_"+Ext.getCmp("tabs").items.length+1,
			        loadScripts: true,
			        scripts: true,
			        autoEl : {
			            tag : "iframe",
			            src : "pilotage/modelmangement/gestionassignemodelctivite"
			        }
				    
				}
		).show();

    }

}



                	          ]///////fin menu
                }, 
                {
                    text: 'Gestion Des Plateformes',
             	   
             	   menu: [
             	          
             	          

							{
								 text: 'Ajouter un clients',
								 handler: function() { // adding a handler to "Add New X" menu item
								 	Ext.getCmp("tabs").add(
												{
													title: 'Ajout client',
													height:'300',
													closable:true,
											        xtype : "component",
											        id    : "management_"+Ext.getCmp("tabs").items.length+1,
											        loadScripts: true,
											        scripts: true,
											        autoEl : {
											            tag : "iframe",
											            src : "pilotage/manageproject/addclients"
											        }
												    
												}
										).show();
								
								 }
								
								},
								{
									 text: 'Gestion des clients',
									 handler: function() { // adding a handler to "Add New X" menu item
									 	Ext.getCmp("tabs").add(
													{
														title: 'Gestion des clients',
														height:'300',
														closable:true,
												        xtype : "component",
												        id    : "management_"+Ext.getCmp("tabs").items.length+1,
												        loadScripts: true,
												        scripts: true,
												        autoEl : {
												            tag : "iframe",
												            src : "pilotage/manageproject/gestionclient"
												        }
													    
													}
											).show();
									
									 }
									
									},
             	          
									{
										 text: 'Ajouter une requete',
										 handler: function() { // adding a handler to "Add New X" menu item
										 	Ext.getCmp("tabs").add(
														{
															title: 'Ajout requete',
															height:'300',
															closable:true,
													        xtype : "component",
													        id    : "management_"+Ext.getCmp("tabs").items.length+1,
													        loadScripts: true,
													        scripts: true,
													        autoEl : {
													            tag : "iframe",
													            src : "pilotage/modelmangement/defrequete"
													        }
														    
														}
												).show();
										
										 }
										
										},
										
             	          
							{
							 text: 'Gestion Des requetes',
							 handler: function() { // adding a handler to "Add New X" menu item
							 	Ext.getCmp("tabs").add(
											{
												title: 'Gestion des requetes',
												height:'300',
												closable:true,
										        xtype : "component",
										        id    : "management_"+Ext.getCmp("tabs").items.length+1,
										        loadScripts: true,
										        scripts: true,
										        autoEl : {
										            tag : "iframe",
										            src : "pilotage/modelmangement/managerequest"
										        }
											    
											}
									).show();
							
							 }
							
							},
							
							
										
										
											{
												 text: 'Ajouter contrainte',
												 handler: function() { // adding a handler to "Add New X" menu item
												 	Ext.getCmp("tabs").add(
																{
																	title: 'Ajout contrainte',
																	height:'300',
																	closable:true,
															        xtype : "component",
															        id    : "management_"+Ext.getCmp("tabs").items.length+1,
															        loadScripts: true,
															        scripts: true,
															        autoEl : {
															            tag : "iframe",
															            src : "pilotage/modelmangement/constraint"
															        }
																    
																}
														).show();
												
												 }
												
												},
									
												
												{
													 text: 'Consulter les contraintes',
													 handler: function() { // adding a handler to "Add New X" menu item
													 	Ext.getCmp("tabs").add(
																	{
																		title: 'Consulter les contraintes',
																		height:'300',
																		closable:true,
																        xtype : "component",
																        id    : "management_"+Ext.getCmp("tabs").items.length+1,
																        loadScripts: true,
																        scripts: true,
																        autoEl : {
																            tag : "iframe",
																            src : "pilotage/modelmangement/consulterconstraint"
																        }
																	    
																	}
															).show();
													
													 }
													
													},
										
													{
														 text: 'Configurer le nom du colonne',
														 handler: function() { // adding a handler to "Add New X" menu item
														 	Ext.getCmp("tabs").add(
																		{
																			title: 'Configurer le nom du colonne',
																			height:'300',
																			closable:true,
																	        xtype : "component",
																	        id    : "management_"+Ext.getCmp("tabs").items.length+1,
																	        loadScripts: true,
																	        scripts: true,
																	        autoEl : {
																	            tag : "iframe",
																	            src : "pilotage/modelmangement/ajouternamecolonne"
																	        }
																		    
																		}
																).show();
														
														 }
														
														},
														
														{
															 text: 'Gerer la configuration des colonnes',
															 handler: function() { // adding a handler to "Add New X" menu item
															 	Ext.getCmp("tabs").add(
																			{
																				title: 'Gerer la configuration des colonnes',
																				height:'300',
																				closable:true,
																		        xtype : "component",
																		        id    : "management_"+Ext.getCmp("tabs").items.length+1,
																		        loadScripts: true,
																		        scripts: true,
																		        autoEl : {
																		            tag : "iframe",
																		            src : "pilotage/modelmangement/gestionnamecolonnes"
																		        }
																			    
																			}
																	).show();
															
															 }
															
															},
														
															{
																 text: 'Ajouter une colonne',
																 handler: function() { // adding a handler to "Add New X" menu item
																 	Ext.getCmp("tabs").add(
																				{
																					title: 'Ajouter une colonne',
																					height:'300',
																					closable:true,
																			        xtype : "component",
																			        id    : "management_"+Ext.getCmp("tabs").items.length+1,
																			        loadScripts: true,
																			        scripts: true,
																			        autoEl : {
																			            tag : "iframe",
																			            src : "pilotage/modelmangement/definirlistcolon"
																			        }
																				    
																				}
																		).show();
																
																 }
																
																},
																

																{
																	 text: 'Gerer la liste des colonnes',
																	 handler: function() { // adding a handler to "Add New X" menu item
																	 	Ext.getCmp("tabs").add(
																					{
																						title: 'Gerer la liste des colonnes',
																						height:'300',
																						closable:true,
																				        xtype : "component",
																				        id    : "management_"+Ext.getCmp("tabs").items.length+1,
																				        loadScripts: true,
																				        scripts: true,
																				        autoEl : {
																				            tag : "iframe",
																				            src : "pilotage/modelmangement/consulterlistecolonnes"
																				        }
																					    
																					}
																			).show();
																	
																	 }
																	
																	},
																	
																	{
																		 text: 'Definir une colonne',
																		 handler: function() { // adding a handler to "Add New X" menu item
																		 	Ext.getCmp("tabs").add(
																						{
																							title: 'Definir une colonne',
																							height:'300',
																							closable:true,
																					        xtype : "component",
																					        id    : "management_"+Ext.getCmp("tabs").items.length+1,
																					        loadScripts: true,
																					        scripts: true,
																					        autoEl : {
																					            tag : "iframe",
																					            src : "pilotage/modelmangement/ajoutdefcolonne"
																					        }
																						    
																						}
																				).show();
																		
																		 }
																		
																		},
																	
																	
																	{
																		 text: 'Gerer la definition des colonnes',
																		 handler: function() { // adding a handler to "Add New X" menu item
																		 	Ext.getCmp("tabs").add(
																						{
																							title: 'Gerer la definition des colonnes',
																							height:'300',
																							closable:true,
																					        xtype : "component",
																					        id    : "management_"+Ext.getCmp("tabs").items.length+1,
																					        loadScripts: true,
																					        scripts: true,
																					        autoEl : {
																					            tag : "iframe",
																					            src : "pilotage/modelmangement/gestiondefinitiondescolonnes"
																					        }
																						    
																						}
																				).show();
																		
																		 }
																		
																		},
																	
																	
																	
																		
																			
																			
																	
						]
                },
                
                
                '->',
                {
                    text: 'Gestion des donnees',
                  
                    menu: [
                           
		                    {
								 text: 'Extraire les donnees',
								 handler: function() { // adding a handler to "Add New X" menu item
								 	Ext.getCmp("tabs").add(
												{
													title: 'Extraire les donnees',
													height:'300',
													closable:true,
											        xtype : "component",
											        id    : "management_"+Ext.getCmp("tabs").items.length+1,
											        loadScripts: true,
											        scripts: true,
											        autoEl : {
											            tag : "iframe",
											            src : "pilotage/Projectbord/index"
											            	
											            	
											        }
												    
												}
										).show();
								
								 }
								
								}, 
		                   
								
								]
		
                }, 
                {                
                    text: 'Help'
                }, 
                '-',{
                    text: 'Logout'
                }]
            },
		    {
		        region: 'west',
		        collapsible: true,
		        split: true,
		        title: 'Navigation',
		        width: 150,		        
		        items:[
		              
			           {
			        	xtype : 'panel',
			        	id:"westpanel",
			        	listeners:     
			        	{
			        		render:function( a,  eOpts )
			        		{
			        			var controller = getApplication.getController('actiontree');
						        controller.init();
			                }
			        	}
			           }
		         ]
		   
		    }, 
		    {
		        region: 'south',
		        html: '<h1 class="x-panel-header">Page Title</h1>',
		        split: true,
		        height: 50,
		        minHeight: 50
		    }, {
		        region: 'east',
		        title: 'East Panel',
		       
		        collapsible: true,
		         items:[
						{
							xtype: 'buttongroup',
							title: 'Madel Management',
							columns: 1,
								defaults: {
								    scale: 'small'
								},
								items: [{
								   layout:'fit',
								    text: 'Management',
								    iconCls: 'add16',
								    handler: function(){
						        		
						        		Ext.getCmp("tabs").add(
						        				{
						        					title: 'Managment',
						        					height:'300',
						        					closable:true,
					        				        xtype : "component",
					        				        id    : "management_"+Ext.getCmp("tabs").items.length+1,
					        				        loadScripts: true,
					        				        scripts: true,
					        				        autoEl : {
					        				            tag : "iframe",
					        				            src : "pilotage/acceuil/menu"
					        				        }
						        				    
						        				}
						        		).show();
						     
						        	}
								   
								}]
						},
						
						
						{
							xtype: 'buttongroup',
							title: 'projet',
							columns: 1,
								defaults: {
								    scale: 'small'
								},
								items: [
								        
								        {
								        	text:"Projet",
								        	 handler: function(){
								        		 
								        	 }
								        	
								        
								        }]}
						],
		        split: true,
		        width: 150
		    }, {
		        region: 'center',
		        name:"tabs",
		        id:"tabs",
		        xtype: 'tabsview'
		    }]
		});	